package com.micro.modual.extension;

import com.micro.common.MicroConstant;
import com.micro.common.biz.GeneratorCodeUtil;
import com.micro.common.util.SnowFlakeUtil;
import com.micro.modual.entity.OrderConfig;
import com.micro.modual.model.bo.orderconfig.OrderConfigBO;

/**
 * <h1>订单配置表 延展类</h1>
 *
 * @author LevelCoder
 * @version V1.0.0
 * @email LevelCoder@126.com
 * @date 2020-08-04 00:23:26
 */
public class OrderConfigExtension {

    /**
     * <h2>转换: 订单配置表 新增</h2>
     *
     * @param orderConfigBO {@link OrderConfigBO} 订单配置表 新增/修改 请求对象
     * @return {@link OrderConfig} 订单配置表
     */
    public static OrderConfig converAddOrderConfig(OrderConfigBO orderConfigBO) {
        OrderConfig orderConfig = new OrderConfig();
        orderConfig.setId(SnowFlakeUtil.getId());
        orderConfig.setOrderPayOvertime(orderConfigBO.getOrderPayOvertime());
        orderConfig.setNormalOrderOvertime(orderConfigBO.getNormalOrderOvertime());
        orderConfig.setConfirmOvertime(orderConfigBO.getConfirmOvertime());
        orderConfig.setFinishOvertime(orderConfigBO.getFinishOvertime());
        orderConfig.setCommentOvertime(orderConfigBO.getCommentOvertime());
        orderConfig.setAssembleOrderOvertime(orderConfigBO.getAssembleOrderOvertime());
        return orderConfig;
    }

    /**
     * <h2>转换: 订单配置表 修改</h2>
     *
     * @param orderConfigBO {@link OrderConfigBO} 订单配置表 新增/修改 请求对象
     * @return {@link OrderConfig} 订单配置表
     */
    public static OrderConfig converEditOrderConfig(OrderConfigBO orderConfigBO) {
        OrderConfig orderConfig = new OrderConfig();
        orderConfig.setId(orderConfigBO.getId());
        orderConfig.setOrderPayOvertime(orderConfigBO.getOrderPayOvertime());
        orderConfig.setNormalOrderOvertime(orderConfigBO.getNormalOrderOvertime());
        orderConfig.setConfirmOvertime(orderConfigBO.getConfirmOvertime());
        orderConfig.setFinishOvertime(orderConfigBO.getFinishOvertime());
        orderConfig.setCommentOvertime(orderConfigBO.getCommentOvertime());
        orderConfig.setAssembleOrderOvertime(orderConfigBO.getAssembleOrderOvertime());
        return orderConfig;
    }
}
